;2008-05-20
;Av Benjamin Ingberg och Patrik Johansson
;
;Här bestäms hur nivåerna ska se ut och vad som skall ritas ut på dem


(load "board.scm")
(load "evilballoon.scm")
(load "blob.scm")
(load "player1.scm")
(load "player2.scm")
(load "wall.scm")
(load "lispmonster.scm")

(define (repeat board func n)
  (if (> n 0)
      (begin (func board)
             (repeat board func (- n 1)))))
;Hjälpfunktion för att rekrusivt rita ut större mängder av monster/väggar

(define level1%
  (class board%
    (super-new [w 624][h 480][bg "./backgrounds/grass-background.png"])
    
    (send this add-player (new player1%
                               [x 0]
                               [y 0]))
    (repeat this (lambda (board)
                   (send board add-world-object (new wall% [x (* 48 (random 6))][y (+ 48 (* 48 (random 5)))]))) 15)
    (repeat this (lambda (board)
                   (send board add-character (new evilballoon% [x (+ 336 (* 48 (random 3)))][y (+ 288 (* 48 (random 3)))]))) 2)
    (repeat this (lambda (board)
                   (send board add-character (new blob% [x (+ 336 (* 48 (random 3)))][y (+ 280 (* 48 (random 3)))]))) 2)))


(define level2%
  (class board%
    (super-new [w 624][h 480][bg "./backgrounds/grass-background.png"])
    
    (send this add-player (new player1%
                               [x 0]
                               [y 0]))
    (repeat this (lambda (board)
                   (send board add-world-object (new wall% [x (* 48 (random 6))][y (+ 48 (* 48 (random 5)))]))) 15)
    (repeat this (lambda (board)
                   (send board add-character (new evilballoon% [x (+ 336 (* 48 (random 3)))][y (+ 288 (* 48 (random 3)))]))) 4)
    (repeat this (lambda (board)
                   (send board add-character (new blob% [x (+ 336 (* 48 (random 3)))][y (+ 280 (* 48 (random 3)))]))) 4)))

(define level3%
  (class board%
    (super-new [w 624][h 480][bg "./backgrounds/lispmonster-cave.png"])
    
    (send this add-player (new player1%
                               [x 0]
                               [y 0]))
    (send this add-player (new player2%
                               [x 576]
                               [y 0]))
    (send this add-character (new lispmonster% [x 312][y 200]))
    (repeat this (lambda (board)
                   (send board add-world-object (new wall% [x (* 48 (random 13))][y (+ 48 (* 48 (random 9)))]))) 40)))